/*
 * Copyright 2012 ilem, Inc. www.ilemgroup.com 
 * Geneva, Switzerland
 * All rights reserved.
 */
package ch.ilem.common.dao;

import java.lang.Class;
import java.util.logging.Logger;

import ch.ilem.common.dao.DaoGenericService;


/**
 * @author <a href="mailto:philippe.delobel@ilem.ch">Philippe Delobel</a>
 * @date 19.12.2010
 * @version $$Revision$$
 */
public class DaoFactory {
		
    public static Logger logger = Logger.getLogger(DaoFactory.class.getName());

	@SuppressWarnings("rawtypes")
	public static  DaoGenericService getInstance(Class clazz) {
		
		DaoGenericService result = null;
		
		try {
			result = (DaoGenericService) Class.forName(clazz.getName()).newInstance();
			logger.info("Class=[" + clazz.getName() + " loaded.");
		} catch (Exception e) {
			logger.severe("Error during class loading=[" + clazz.getName() + "].");
		}
		return result;
	}
	
}
